Added unit handling to STEP import and export#2023
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2023 +/- ##
=======================================
Coverage 95.00% 95.01%
=======================================
Files 30 31 +1
Lines 8749 8765 +16
Branches 1298 1298
=======================================
+ Hits 8312 8328 +16
Misses 289 289
Partials 148 148 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for picking this up @jmwright , this is very needed! Could you also add another option to export (e.g. |
|
@adam-urbanczyk Is the current implementation that you had in mind? |
|
Yes, thanks! Just give me some time to review. |
adam-urbanczyk
left a comment
There was a problem hiding this comment.
So I found a few things:
- It would be nice to support
mmon top ofMM - I think import should reply on "cascade.unit"
- Would it be possible to support xbf an xml too?
| step_reader.SetSHUOMode(True) | ||
|
|
||
| Interface_Static.SetIVal_s("read.stepcaf.subshapes.name", 1) | ||
| Interface_Static.SetCVal_s("read.step.unit", unit) |
There was a problem hiding this comment.
Also, shouldn't this also apply to xbf and xml imports?
There was a problem hiding this comment.
I think those settings only apply to STEP handling. Are you saying that you want it to apply to xbf and xml as well, or are you asking if the settings apply to them?
There was a problem hiding this comment.
I meant assuming xstep.cascade.unit will be used
Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
|
@adam-urbanczyk Are the mypy errors I'm getting now related to the ones you are getting on the nurbs PR? |
|
Not really, new release of mypy got more strict (as it usually does). |
Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
@adam-urbanczyk @lorenzncode This fixes a long-standing issue where things are at the wrong scale when exchanging STEP files because CadQuery did not use OCCT's units mechanism.